switch($var){
    case 0:
        // do stuff
        break;
    case 1:
        //do stuff
        break;
    case 2:
        //do stuff
        break;
    default:
        //do stuff
        break;
}
